//
//  ZXYBubbleView.m
//  Targeting
//
//  Created by zhouxiaoyu on 14-6-24.
//  Copyright (c) 2014年 duostec. All rights reserved.
//

#import "ZXYBubbleView.h"
@interface ZXYBubbleView()
{
    
    CGPoint location;
    UIColor *circleColor;
}
@end
@implementation ZXYBubbleView

- (id)initWithWidth:(float)radio andColor:(UIColor *)color
{
    if(self = [super init])
    {
        circleColor = [[UIColor alloc] initWithCGColor:color.CGColor];
        self.radius = radio;
        self.backgroundColor = [UIColor clearColor];
        self.frame = CGRectMake(0, 0, radio, radio);
    }
    return self;
}

- (void)setPosition:(CGPoint)point
{
    location = point;
    
}


- (void)drawRect:(CGRect)rect
{
    self.backgroundColor = [UIColor clearColor];
    self.alpha = 0.6;
    [super drawRect:rect];
    CGContextRef contextref = UIGraphicsGetCurrentContext();
    if(circleColor)
    {
        [circleColor set];
    }
    else
    {
        [[UIColor redColor] set];
    }
    CGContextFillEllipseInRect(contextref, rect);
    CGContextStrokePath(contextref);
}


@end
